package com.zx.flow.api.execute.request;

import com.zx.flow.api.execute.model.FlowContext;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@Schema(title = "流程-创建子流程", description = "流程-创建子流程")
public class FlowParamSubFlow extends FlowParam {

    @NotNull
    @Schema(description = "父流程对象", requiredMode = RequiredMode.REQUIRED)
    private FlowContext parentFlow;

    @Schema(description = "开启子流程的节点id", example = "5cf79580-07c9-4bf1-b061-51561a6748ee", requiredMode = RequiredMode.REQUIRED)
    @NotEmpty(message = "流程节点id不能为空")
    private String nodeId;

    public FlowParamSubFlow(FlowContext parentFlow, String nodeId) {
        this.parentFlow = parentFlow;
        this.nodeId = nodeId;
    }
}
